package Java学习;

public class Double保留小数位数 {
    public static void main(String[] args) {
        double a = 3.1415926;
        System.out.println((double) Math.round(a*1000)/1000);
    }
}
